<%@page import="javax.jws.soap.SOAPBinding"%>
<%@page import="com.itwill.ecom.company.CompanyBeans"%>
<%@page import="com.itwill.ecom.company.CompanyService"%>
<%@page import="com.itwill.ecom.category.CategoryBeans"%>
<%@page import="com.itwill.ecom.category.CategoryService"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.itwill.ecom.product.ProductBeans"%>
<%@page import="java.util.List"%>
<%@page import="com.itwill.ecom.product.ProductService"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	WebApplicationContext webContext = WebApplicationContextUtils.getWebApplicationContext(application);
	CategoryService categoryService = (CategoryService)webContext.getBean("categoryService");
	CompanyService companyService = (CompanyService)webContext.getBean("companyService");
	
	List<CategoryBeans> categoryList = new ArrayList<CategoryBeans>();
	List<CompanyBeans> companyList = new ArrayList<CompanyBeans>();
	
	categoryList = categoryService.getCategoryAll();
	companyList = companyService.getAllCompany();
%>

	<div class="left-sidebar">
		<!--brands_products-->
		<h2>제조사</h2>
		<div class="panel-group category-products" id="accordian">
			<%
				for(CompanyBeans beans : companyList){
			%>
			<div class="panel panel-default">
				<div class="panel-heading">
					<h4 class="panel-title">
						<a href="${pageContext.request.contextPath}/product/companyList?companyno=<%=beans.getCompany_no()%>">
							<%= beans.getCompany_name() %>
						</a>
					</h4>
				</div>
			</div>
			<%} %>
		</div>
		<!--/brands_products-->
		
		<!--/shipping-->

		<h2>카테고리</h2>
		<div class="panel-group category-products" id="accordian">
			<!--category-productsr-->
			<%
				for(CategoryBeans beans : categoryList){
			%>
			<div class="panel panel-default">
				<div class="panel-heading">
					<h4 class="panel-title">
						<a href="${pageContext.request.contextPath}/product/categoryList?categoryno=<%=beans.getCategory_no()%>">
							<%= beans.getCategory_name() %>
						</a>
					</h4>
				</div>
			</div>
			<%} %>
		</div>
		<!--/category-products-->
	</div>
